#ifndef _RESOURCEMANAGER_H_
#define _RESOURCEMANAGER_H_

#include "Singleton.hpp"

#include <unordered_map>
#include <memory>


template <typename T>
class ResourceManager : public Singleton<ResourceManager<T>>
{
    friend class Singleton<ResourceManager>;

public:
    std::shared_ptr<T> get(const std::string& name);

    void add(const std::string& name, T* resource);
    void remove(const std::string& name);

private:
    ResourceManager() {}
    ~ResourceManager() {}

    std::unordered_map<std::string, std::shared_ptr<T>> resources_;
};

#include "ResourceManager.inl"


#endif /* _RESOURCEMANAGER_H_ */
